﻿@model FeedbackViewModel
@using VideoSeller.Business.Data.Enums

@{
    ViewBag.Title = "Feedback";
    Layout = "~/Views/Shared/_DefaultLayout.cshtml";
}

<script type="text/javascript">
	$(document).ready(function () {
		$("#regForm").validate({
			rules: {
				Content: { required: true }
			}
		});
	});
</script>

<div class="tabs tab_inner tab_inner_act feedback-zone">
	@Html.Partial("~/Views/Shared/_MainTabs.cshtml", MainTabs.None)
	<h3>@Html.GetLocalResource("Feedback")</h3>
    <br />
	@if (Model.IsFeedbackSend) {		
		<label>@Html.GetLocalResource("FeedbackSend")</label><br/><br/>
		<input type="button" value="OK" onclick="@string.Format("window.location.href='{0}';", Url.Action("Index", "Home"))"/>
	}
	else {
		using (Html.BeginForm("Feedback", "Info", FormMethod.Post, new {id = "regForm"})) {
			@Html.ValidationSummary()
			<label>@Html.GetLocalResource("FeedbackType")</label>
			@Html.DropDownListFor(x => x.FeedbackType, Model.FeedbackTypes.Select(f => new SelectListItem {Text = f, Value = f}))
			<br/><br/>

			<label>@Html.GetLocalResource("Content")</label>
			<br/>
			@Html.TextAreaFor(x => x.Content)<br/>
			<br/><br/>

			<input type="submit" value="@Html.GetLocalResource("Send")"/>
		}
	}
</div>